package com.xk857.forum.controller;


import com.xk857.entities.Replay;
import com.xk857.forum.service.IReplayService;
import com.xk857.util.base.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 星空小屋-回复论坛信息表 前端控制器
 *
 * @author CV大魔王
 * @since 2021-02-23
 */
@Api(value = "评论信息接口", tags = "评论信息接口")
@RestController
@RequestMapping("/pri/replay")
public class ReplayController {

    @Autowired
    private IReplayService replayService;


    @ApiImplicitParam(name="id", value="评论ID", required=true)
    @ApiOperation("删除评论接口")
    @DeleteMapping("/{id}")
    public Result delete(@PathVariable("id") String id) {
        return replayService.deleteById(id);
    }


    @ApiOperation("新增回答信息接口")
    @PostMapping
    public Result add(@RequestBody Replay replay){
        return replayService.add(replay);
    }


}
